package com.hongyuan.sellfitness.ui.find.view_mode;

import androidx.annotation.NonNull;
import androidx.databinding.ObservableField;
import com.hongyuan.mvvmhabitx.binding.command.BindingCommand;
import com.hongyuan.sellfitness.base.Constants;
import com.hongyuan.sellfitness.base.CustomViewModel;
import com.hongyuan.sellfitness.base.ItemViewModel;
import com.hongyuan.sellfitness.ui.find.beans.CircleBeans;


public class ChoseCricleLeftItemViewModel extends ItemViewModel<CustomViewModel> {

    public ObservableField<CircleBeans.ListBean> entity = new ObservableField<>();

    public ChoseCricleLeftItemViewModel(@NonNull CustomViewModel viewModel, CircleBeans.ListBean bean) {
        super(viewModel);
        entity.set(bean);
    }

    //点击事件
    public BindingCommand onClick = new BindingCommand(() -> {
        viewModel.itemClick(this);

        viewModel.setParams("parent_id",String.valueOf(entity.get().getCategory_id()));
        viewModel.requestData(Constants.GET_CIRCLE_CATEGORY_LIST);
    });
}
